-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: automatically generate list of library_files #3506
Conversation
o['variables']['library_files'] = modules | ||
lib_dir = os.path.join(root_dir, 'lib') | ||
for root, dirs, files in os.walk(lib_dir): | ||
modules += map(lambda xs: os.path.join(root, xs)[2:], files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us say that my editor creates a temporary file, then if I run ./configure
, it will include that as well. Probably, we need to filter out the files which end with .js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed now. Good catch!
I don't really see the point. If you forget to add a new file, you'll find out soon enough because tests will start failing. Similarly, when you forget to remove a deleted file from the list, the build will fail at the j2sc step. |
I'm mostly scratching an itch, here — the extra step of making sure the file was present in the gypfile is easy to forget (until you recompile and test), wasn't obvious when I was a newcomer, and presents a human-monitored style rule in PRs (I recall there was a comment about putting the files in the correct alphabetical order in the gypfile at some point?) It's definitely not a huge change, but I've run into it enough that I wanted to smooth this corner. |
I'm -0 to this PR but there's a pretty convincing argument regarding where to look/edit if you're actually adding a file to |
LGTM, but I'm +0.1 on whether it's needed ;-) |
heh, +0.1 for me too, that gets us to +0.2, lgtm |
Uh, what's the reason to not do this programatically? SGTM? (I don't want to sign off because python tho) |
@chrisdickinson Is this something you still want? Or would you be inclined to close this? (I have no opinion either way, just trying to tidy up inactive PRs a bit.) |
ping @chrisdickinson |
@Fishrock123 the counter argument would be that we're introducing an additional layer which down the road could be more error prone than just editing the file. Another (far fetched) argument would be that |
Meh. The build will just fail if you don't edit it anyways. let's close unless someone wants to pick it up. |
Automatically generate the list of library_files by using Python's
os.walk
so we don't have to remember to specify new files (or remember to remove old ones.)Example output: